interface Add {
  (x: number, y: number) : number
}

let add: Add = (x, y) => x + y;


interface Lib {
  (): void,
  version: string,
  doNothing(): void
}

function getLib() {
  let lib: Lib = (() => {}) as Lib;
  lib.version = '1.0.0';
  lib.doNothing = () => {};
  return lib;
}

let lib1 = getLib();
lib1();
lib1.doNothing();
let lib2 = getLib();
lib2.doNothing();


